<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Vue 示例</title>
</head>
<body>
    <div id="app">
        <h1>单选按钮数据绑定</h1>
        <input type="radio" v-model="picked" :value="value"></input>
        <p>{{picked}}</p>
        <p>{{value}}</p>
        <h1>复选框数据绑定</h1>
        <input type="checkbox" v-model="toggle" :true-value="value1" :false-value="value2"></input>
        <p>{{toggle}}</p>
        <p>{{value1}}</p>
        <p>{{value2}}</p>
        <h1>选择列表数据绑定</h1>
        <select v-model="selected">
            <option :value="{number: 123}">123</option>
        </select>
        <p>{{selected.number}}</p>
    </div>

    <script src="http://unpkg.com/vue/dist/vue.min.js"></script>
    <script>
        // 变量app表示一个vue实例
        var app = new Vue({
            el: '#app', //用于指定一个页面中存在的Dom元素来挂载Vue示例。挂载成功后可以使用app.$el来访问该元素
            data: {
                picked: true,
                toggle: false,
                value: '1234',
                value1: 'a',
                value2: 'b',
                selected: ''
            }
        })
    </script>
</body>
</html>